﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace CashingDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnShowNo_Click(object sender, EventArgs e)
        {
            object obj = HttpRuntime.Cache.Get("myCache");
            if (obj == null)
            {
                HttpRuntime.Cache.Add("myCache", "10", null, DateTime.Now.AddMinutes(2), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.High, null);
                Label1.Text = "Value is 10";
            }
            else
            {
                int n = Convert.ToInt32(obj) + 10;
                Label1.Text = "Value is from Cache " + n;
            }
        }
    }
}
